From d7bfbdb5fea628fd28625f754dadba2ef0d90b9c Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 10 Feb 2003 19:20:06 +0000 Subject: [PATCH] Create a shortname when we don't have one. --- gpsbabel/waypt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gpsbabel/waypt.c b/gpsbabel/waypt.c index 49704b4d5..7b916040b 100644 --- a/gpsbabel/waypt.c +++ b/gpsbabel/waypt.c @@ -37,6 +37,21 @@ void waypt_add(waypoint *wpt) { ENQUEUE_TAIL(&waypt_head, &wpt->Q); + + /* + * Some input may not have one or more of these types so we + * try to be sure that we have these fields even if just by + * copying them from elsewhere. + */ + if (wpt->shortname == NULL) { + if (wpt->description) { + wpt->shortname = xstrdup(wpt->description); + } else { + if (wpt->notes) { + wpt->shortname = xstrdup(wpt->notes); + } + } + } if (wpt->description == NULL) { if (wpt->notes != NULL) { wpt->description = xstrdup(wpt->notes); -- 2.30.2